\(\int \frac {(2+x) (d+e x+f x^2)}{(4-5 x^2+x^4)^2} \, dx\) [99]

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [A] (verified)
   Fricas [B] (verification not implemented)
   Sympy [F(-1)]
   Maxima [A] (verification not implemented)
   Giac [A] (verification not implemented)
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 26, antiderivative size = 122 \[ \int \frac {(2+x) \left (d+e x+f x^2\right )}{\left (4-5 x^2+x^4\right )^2} \, dx=\frac {d+e+f}{12 (1-x)}+\frac {d+2 e+4 f}{36 (2-x)}-\frac {d-e+f}{36 (1+x)}+\frac {1}{36} (2 d+5 e+8 f) \log (1-x)-\frac {1}{432} (35 d+58 e+92 f) \log (2-x)+\frac {1}{108} (2 d+e-4 f) \log (1+x)+\frac {1}{144} (d-2 e+4 f) \log (2+x) \]

[Out]

1/12*(d+e+f)/(1-x)+1/36*(d+2*e+4*f)/(2-x)+1/36*(-d+e-f)/(1+x)+1/36*(2*d+5*e+8*f)*ln(1-x)-1/432*(35*d+58*e+92*f
)*ln(2-x)+1/108*(2*d+e-4*f)*ln(1+x)+1/144*(d-2*e+4*f)*ln(2+x)

Rubi [A] (verified)

Time = 0.15 (sec) , antiderivative size = 122, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 2, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.077, Rules used = {1600, 6874} \[ \int \frac {(2+x) \left (d+e x+f x^2\right )}{\left (4-5 x^2+x^4\right )^2} \, dx=-\frac {d-e+f}{36 (x+1)}+\frac {d+e+f}{12 (1-x)}+\frac {d+2 e+4 f}{36 (2-x)}+\frac {1}{36} \log (1-x) (2 d+5 e+8 f)-\frac {1}{432} \log (2-x) (35 d+58 e+92 f)+\frac {1}{108} \log (x+1) (2 d+e-4 f)+\frac {1}{144} \log (x+2) (d-2 e+4 f) \]

[In]

Int[((2 + x)*(d + e*x + f*x^2))/(4 - 5*x^2 + x^4)^2,x]

[Out]

(d + e + f)/(12*(1 - x)) + (d + 2*e + 4*f)/(36*(2 - x)) - (d - e + f)/(36*(1 + x)) + ((2*d + 5*e + 8*f)*Log[1
- x])/36 - ((35*d + 58*e + 92*f)*Log[2 - x])/432 + ((2*d + e - 4*f)*Log[1 + x])/108 + ((d - 2*e + 4*f)*Log[2 +
 x])/144

Rule 1600

Int[(u_.)*(Px_)^(p_.)*(Qx_)^(q_.), x_Symbol] :> Int[u*PolynomialQuotient[Px, Qx, x]^p*Qx^(p + q), x] /; FreeQ[
q, x] && PolyQ[Px, x] && PolyQ[Qx, x] && EqQ[PolynomialRemainder[Px, Qx, x], 0] && IntegerQ[p] && LtQ[p*q, 0]

Rule 6874

Int[u_, x_Symbol] :> With[{v = ExpandIntegrand[u, x]}, Int[v, x] /; SumQ[v]]

Rubi steps \begin{align*} \text {integral}& = \int \frac {d+e x+f x^2}{(2+x) \left (2-x-2 x^2+x^3\right )^2} \, dx \\ & = \int \left (\frac {d+2 e+4 f}{36 (-2+x)^2}+\frac {-35 d-58 e-92 f}{432 (-2+x)}+\frac {d+e+f}{12 (-1+x)^2}+\frac {2 d+5 e+8 f}{36 (-1+x)}+\frac {d-e+f}{36 (1+x)^2}+\frac {2 d+e-4 f}{108 (1+x)}+\frac {d-2 e+4 f}{144 (2+x)}\right ) \, dx \\ & = \frac {d+e+f}{12 (1-x)}+\frac {d+2 e+4 f}{36 (2-x)}-\frac {d-e+f}{36 (1+x)}+\frac {1}{36} (2 d+5 e+8 f) \log (1-x)-\frac {1}{432} (35 d+58 e+92 f) \log (2-x)+\frac {1}{108} (2 d+e-4 f) \log (1+x)+\frac {1}{144} (d-2 e+4 f) \log (2+x) \\ \end{align*}

Mathematica [A] (verified)

Time = 0.04 (sec) , antiderivative size = 121, normalized size of antiderivative = 0.99 \[ \int \frac {(2+x) \left (d+e x+f x^2\right )}{\left (4-5 x^2+x^4\right )^2} \, dx=\frac {1}{432} \left (\frac {12 \left (d \left (5+6 x-5 x^2\right )+e \left (10-4 x^2\right )+2 f \left (4+3 x-4 x^2\right )\right )}{2-x-2 x^2+x^3}+12 (2 d+5 e+8 f) \log (1-x)-(35 d+58 e+92 f) \log (2-x)+4 (2 d+e-4 f) \log (1+x)+3 (d-2 e+4 f) \log (2+x)\right ) \]

[In]

Integrate[((2 + x)*(d + e*x + f*x^2))/(4 - 5*x^2 + x^4)^2,x]

[Out]

((12*(d*(5 + 6*x - 5*x^2) + e*(10 - 4*x^2) + 2*f*(4 + 3*x - 4*x^2)))/(2 - x - 2*x^2 + x^3) + 12*(2*d + 5*e + 8
*f)*Log[1 - x] - (35*d + 58*e + 92*f)*Log[2 - x] + 4*(2*d + e - 4*f)*Log[1 + x] + 3*(d - 2*e + 4*f)*Log[2 + x]
)/432

Maple [A] (verified)

Time = 0.08 (sec) , antiderivative size = 113, normalized size of antiderivative = 0.93

method result size
default \(\left (\frac {d}{144}-\frac {e}{72}+\frac {f}{36}\right ) \ln \left (x +2\right )-\frac {\frac {d}{36}-\frac {e}{36}+\frac {f}{36}}{x +1}+\left (\frac {d}{54}+\frac {e}{108}-\frac {f}{27}\right ) \ln \left (x +1\right )-\frac {\frac {d}{12}+\frac {e}{12}+\frac {f}{12}}{x -1}+\left (\frac {d}{18}+\frac {5 e}{36}+\frac {2 f}{9}\right ) \ln \left (x -1\right )+\left (-\frac {35 d}{432}-\frac {29 e}{216}-\frac {23 f}{108}\right ) \ln \left (x -2\right )-\frac {\frac {d}{36}+\frac {e}{18}+\frac {f}{9}}{x -2}\) \(113\)
norman \(\frac {\left (-\frac {5 d}{36}-\frac {e}{9}-\frac {2 f}{9}\right ) x^{3}+\left (\frac {17 d}{36}+\frac {5 e}{18}+\frac {5 f}{9}\right ) x +\left (-\frac {d}{9}-\frac {2 e}{9}-\frac {5 f}{18}\right ) x^{2}+\frac {5 d}{18}+\frac {5 e}{9}+\frac {4 f}{9}}{x^{4}-5 x^{2}+4}+\left (-\frac {35 d}{432}-\frac {29 e}{216}-\frac {23 f}{108}\right ) \ln \left (x -2\right )+\left (\frac {d}{18}+\frac {5 e}{36}+\frac {2 f}{9}\right ) \ln \left (x -1\right )+\left (\frac {d}{54}+\frac {e}{108}-\frac {f}{27}\right ) \ln \left (x +1\right )+\left (\frac {d}{144}-\frac {e}{72}+\frac {f}{36}\right ) \ln \left (x +2\right )\) \(125\)
risch \(\frac {\left (-\frac {5 d}{36}-\frac {e}{9}-\frac {2 f}{9}\right ) x^{2}+\left (\frac {d}{6}+\frac {f}{6}\right ) x +\frac {5 d}{36}+\frac {5 e}{18}+\frac {2 f}{9}}{x^{3}-2 x^{2}-x +2}+\frac {\ln \left (x +2\right ) d}{144}-\frac {\ln \left (x +2\right ) e}{72}+\frac {\ln \left (x +2\right ) f}{36}-\frac {35 \ln \left (2-x \right ) d}{432}-\frac {29 \ln \left (2-x \right ) e}{216}-\frac {23 \ln \left (2-x \right ) f}{108}+\frac {\ln \left (x -1\right ) d}{18}+\frac {5 \ln \left (x -1\right ) e}{36}+\frac {2 \ln \left (x -1\right ) f}{9}+\frac {\ln \left (-x -1\right ) d}{54}+\frac {\ln \left (-x -1\right ) e}{108}-\frac {\ln \left (-x -1\right ) f}{27}\) \(147\)
parallelrisch \(-\frac {-96 f +60 d \,x^{2}-60 d -120 e +96 f \,x^{2}-72 d x -60 \ln \left (x -1\right ) x^{3} e -8 \ln \left (x +1\right ) x^{3} d -4 \ln \left (x +1\right ) x^{3} e -3 \ln \left (x +2\right ) x^{3} d +6 \ln \left (x +2\right ) x^{3} e +70 \ln \left (x -2\right ) d +116 \ln \left (x -2\right ) e -48 \ln \left (x -1\right ) d -120 \ln \left (x -1\right ) e -24 \ln \left (x +2\right ) f +32 \ln \left (x +1\right ) f +48 e \,x^{2}+58 \ln \left (x -2\right ) x^{3} e -24 \ln \left (x -1\right ) x^{3} d -6 \ln \left (x +2\right ) x e -58 \ln \left (x -2\right ) x e +24 \ln \left (x -1\right ) x d +60 \ln \left (x -1\right ) x e +8 \ln \left (x +1\right ) x d +4 \ln \left (x +1\right ) x e +3 \ln \left (x +2\right ) x d -116 \ln \left (x -2\right ) x^{2} e +48 \ln \left (x -1\right ) x^{2} d +120 \ln \left (x -1\right ) x^{2} e +16 \ln \left (x +1\right ) x^{2} d +8 \ln \left (x +1\right ) x^{2} e +6 \ln \left (x +2\right ) x^{2} d -12 \ln \left (x +2\right ) x^{2} e -6 \ln \left (x +2\right ) d -92 \ln \left (x -2\right ) x f +96 \ln \left (x -1\right ) x f -16 \ln \left (x +1\right ) x f +12 \ln \left (x +2\right ) x f +12 \ln \left (x +2\right ) e -16 \ln \left (x +1\right ) d -8 \ln \left (x +1\right ) e -35 \ln \left (x -2\right ) x d +35 \ln \left (x -2\right ) x^{3} d -184 \ln \left (x -2\right ) x^{2} f +192 \ln \left (x -1\right ) x^{2} f -32 \ln \left (x +1\right ) x^{2} f +24 \ln \left (x +2\right ) x^{2} f +92 \ln \left (x -2\right ) x^{3} f -96 \ln \left (x -1\right ) x^{3} f +16 \ln \left (x +1\right ) x^{3} f -12 \ln \left (x +2\right ) x^{3} f +184 \ln \left (x -2\right ) f -192 \ln \left (x -1\right ) f -70 \ln \left (x -2\right ) x^{2} d -72 f x}{432 \left (x^{3}-2 x^{2}-x +2\right )}\) \(474\)

[In]

int((x+2)*(f*x^2+e*x+d)/(x^4-5*x^2+4)^2,x,method=_RETURNVERBOSE)

[Out]

(1/144*d-1/72*e+1/36*f)*ln(x+2)-(1/36*d-1/36*e+1/36*f)/(x+1)+(1/54*d+1/108*e-1/27*f)*ln(x+1)-(1/12*d+1/12*e+1/
12*f)/(x-1)+(1/18*d+5/36*e+2/9*f)*ln(x-1)+(-35/432*d-29/216*e-23/108*f)*ln(x-2)-(1/36*d+1/18*e+1/9*f)/(x-2)

Fricas [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 267 vs. \(2 (104) = 208\).

Time = 0.36 (sec) , antiderivative size = 267, normalized size of antiderivative = 2.19 \[ \int \frac {(2+x) \left (d+e x+f x^2\right )}{\left (4-5 x^2+x^4\right )^2} \, dx=-\frac {12 \, {\left (5 \, d + 4 \, e + 8 \, f\right )} x^{2} - 72 \, {\left (d + f\right )} x - 3 \, {\left ({\left (d - 2 \, e + 4 \, f\right )} x^{3} - 2 \, {\left (d - 2 \, e + 4 \, f\right )} x^{2} - {\left (d - 2 \, e + 4 \, f\right )} x + 2 \, d - 4 \, e + 8 \, f\right )} \log \left (x + 2\right ) - 4 \, {\left ({\left (2 \, d + e - 4 \, f\right )} x^{3} - 2 \, {\left (2 \, d + e - 4 \, f\right )} x^{2} - {\left (2 \, d + e - 4 \, f\right )} x + 4 \, d + 2 \, e - 8 \, f\right )} \log \left (x + 1\right ) - 12 \, {\left ({\left (2 \, d + 5 \, e + 8 \, f\right )} x^{3} - 2 \, {\left (2 \, d + 5 \, e + 8 \, f\right )} x^{2} - {\left (2 \, d + 5 \, e + 8 \, f\right )} x + 4 \, d + 10 \, e + 16 \, f\right )} \log \left (x - 1\right ) + {\left ({\left (35 \, d + 58 \, e + 92 \, f\right )} x^{3} - 2 \, {\left (35 \, d + 58 \, e + 92 \, f\right )} x^{2} - {\left (35 \, d + 58 \, e + 92 \, f\right )} x + 70 \, d + 116 \, e + 184 \, f\right )} \log \left (x - 2\right ) - 60 \, d - 120 \, e - 96 \, f}{432 \, {\left (x^{3} - 2 \, x^{2} - x + 2\right )}} \]

[In]

integrate((2+x)*(f*x^2+e*x+d)/(x^4-5*x^2+4)^2,x, algorithm="fricas")

[Out]

-1/432*(12*(5*d + 4*e + 8*f)*x^2 - 72*(d + f)*x - 3*((d - 2*e + 4*f)*x^3 - 2*(d - 2*e + 4*f)*x^2 - (d - 2*e +
4*f)*x + 2*d - 4*e + 8*f)*log(x + 2) - 4*((2*d + e - 4*f)*x^3 - 2*(2*d + e - 4*f)*x^2 - (2*d + e - 4*f)*x + 4*
d + 2*e - 8*f)*log(x + 1) - 12*((2*d + 5*e + 8*f)*x^3 - 2*(2*d + 5*e + 8*f)*x^2 - (2*d + 5*e + 8*f)*x + 4*d +
10*e + 16*f)*log(x - 1) + ((35*d + 58*e + 92*f)*x^3 - 2*(35*d + 58*e + 92*f)*x^2 - (35*d + 58*e + 92*f)*x + 70
*d + 116*e + 184*f)*log(x - 2) - 60*d - 120*e - 96*f)/(x^3 - 2*x^2 - x + 2)

Sympy [F(-1)]

Timed out. \[ \int \frac {(2+x) \left (d+e x+f x^2\right )}{\left (4-5 x^2+x^4\right )^2} \, dx=\text {Timed out} \]

[In]

integrate((2+x)*(f*x**2+e*x+d)/(x**4-5*x**2+4)**2,x)

[Out]

Timed out

Maxima [A] (verification not implemented)

none

Time = 0.20 (sec) , antiderivative size = 108, normalized size of antiderivative = 0.89 \[ \int \frac {(2+x) \left (d+e x+f x^2\right )}{\left (4-5 x^2+x^4\right )^2} \, dx=\frac {1}{144} \, {\left (d - 2 \, e + 4 \, f\right )} \log \left (x + 2\right ) + \frac {1}{108} \, {\left (2 \, d + e - 4 \, f\right )} \log \left (x + 1\right ) + \frac {1}{36} \, {\left (2 \, d + 5 \, e + 8 \, f\right )} \log \left (x - 1\right ) - \frac {1}{432} \, {\left (35 \, d + 58 \, e + 92 \, f\right )} \log \left (x - 2\right ) - \frac {{\left (5 \, d + 4 \, e + 8 \, f\right )} x^{2} - 6 \, {\left (d + f\right )} x - 5 \, d - 10 \, e - 8 \, f}{36 \, {\left (x^{3} - 2 \, x^{2} - x + 2\right )}} \]

[In]

integrate((2+x)*(f*x^2+e*x+d)/(x^4-5*x^2+4)^2,x, algorithm="maxima")

[Out]

1/144*(d - 2*e + 4*f)*log(x + 2) + 1/108*(2*d + e - 4*f)*log(x + 1) + 1/36*(2*d + 5*e + 8*f)*log(x - 1) - 1/43
2*(35*d + 58*e + 92*f)*log(x - 2) - 1/36*((5*d + 4*e + 8*f)*x^2 - 6*(d + f)*x - 5*d - 10*e - 8*f)/(x^3 - 2*x^2
 - x + 2)

Giac [A] (verification not implemented)

none

Time = 0.28 (sec) , antiderivative size = 112, normalized size of antiderivative = 0.92 \[ \int \frac {(2+x) \left (d+e x+f x^2\right )}{\left (4-5 x^2+x^4\right )^2} \, dx=\frac {1}{144} \, {\left (d - 2 \, e + 4 \, f\right )} \log \left ({\left | x + 2 \right |}\right ) + \frac {1}{108} \, {\left (2 \, d + e - 4 \, f\right )} \log \left ({\left | x + 1 \right |}\right ) + \frac {1}{36} \, {\left (2 \, d + 5 \, e + 8 \, f\right )} \log \left ({\left | x - 1 \right |}\right ) - \frac {1}{432} \, {\left (35 \, d + 58 \, e + 92 \, f\right )} \log \left ({\left | x - 2 \right |}\right ) - \frac {{\left (5 \, d + 4 \, e + 8 \, f\right )} x^{2} - 6 \, {\left (d + f\right )} x - 5 \, d - 10 \, e - 8 \, f}{36 \, {\left (x + 1\right )} {\left (x - 1\right )} {\left (x - 2\right )}} \]

[In]

integrate((2+x)*(f*x^2+e*x+d)/(x^4-5*x^2+4)^2,x, algorithm="giac")

[Out]

1/144*(d - 2*e + 4*f)*log(abs(x + 2)) + 1/108*(2*d + e - 4*f)*log(abs(x + 1)) + 1/36*(2*d + 5*e + 8*f)*log(abs
(x - 1)) - 1/432*(35*d + 58*e + 92*f)*log(abs(x - 2)) - 1/36*((5*d + 4*e + 8*f)*x^2 - 6*(d + f)*x - 5*d - 10*e
 - 8*f)/((x + 1)*(x - 1)*(x - 2))

Mupad [B] (verification not implemented)

Time = 7.90 (sec) , antiderivative size = 113, normalized size of antiderivative = 0.93 \[ \int \frac {(2+x) \left (d+e x+f x^2\right )}{\left (4-5 x^2+x^4\right )^2} \, dx=\ln \left (x-1\right )\,\left (\frac {d}{18}+\frac {5\,e}{36}+\frac {2\,f}{9}\right )+\ln \left (x+1\right )\,\left (\frac {d}{54}+\frac {e}{108}-\frac {f}{27}\right )+\ln \left (x+2\right )\,\left (\frac {d}{144}-\frac {e}{72}+\frac {f}{36}\right )-\ln \left (x-2\right )\,\left (\frac {35\,d}{432}+\frac {29\,e}{216}+\frac {23\,f}{108}\right )-\frac {\left (-\frac {5\,d}{36}-\frac {e}{9}-\frac {2\,f}{9}\right )\,x^2+\left (\frac {d}{6}+\frac {f}{6}\right )\,x+\frac {5\,d}{36}+\frac {5\,e}{18}+\frac {2\,f}{9}}{-x^3+2\,x^2+x-2} \]

[In]

int(((x + 2)*(d + e*x + f*x^2))/(x^4 - 5*x^2 + 4)^2,x)

[Out]

log(x - 1)*(d/18 + (5*e)/36 + (2*f)/9) + log(x + 1)*(d/54 + e/108 - f/27) + log(x + 2)*(d/144 - e/72 + f/36) -
 log(x - 2)*((35*d)/432 + (29*e)/216 + (23*f)/108) - ((5*d)/36 + (5*e)/18 + (2*f)/9 + x*(d/6 + f/6) - x^2*((5*
d)/36 + e/9 + (2*f)/9))/(x + 2*x^2 - x^3 - 2)